//
//  BlockDemo2VC.m
//  MyBlock
//
//  Created by YuanJiang on 2019/9/4.
//  Copyright © 2019 YuanJiang. All rights reserved.
//

#import "BlockDemo2VC.h"
#import "demo2View.h"
@interface BlockDemo2VC ()

@end

@implementation BlockDemo2VC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
}

//点击出现个红色的view
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    for (UIView *v in [self.view subviews]) {
        if (v.tag == 100) {
            return;
        }
    }
    
    demo2View *view = [[demo2View alloc] initWithTitle:@"zzz" complateBlock:^(NSString * _Nonnull value) {
        NSLog(@"传过来的值为 %@",value);
    }];
    view.tag = 100;
    [self.view addSubview:view];
}


@end
